package jkCore;

import android.app.Application;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader;

import jkCore.social.SocialManager;

public class JKCoreApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        ImagePipelineConfig.Builder builder = ImagePipelineConfig.newBuilder(getApplicationContext());
        ImagePipelineConfig imagePipelineConfig = builder.build();
        Fresco.initialize(getApplicationContext(), imagePipelineConfig);
        try {
            ImagePipelineNativeLoader.load();
        } catch (UnsatisfiedLinkError error) {
            Fresco.shutDown();
            builder.experiment().setNativeCodeDisabled(true);
            imagePipelineConfig = builder.build();
            Fresco.initialize(getApplicationContext(), imagePipelineConfig);
            error.printStackTrace();
        }

        SocialManager.initWithApplication(this);
    }
}
